package constvar

const (
	DefaultLimit   = 50
	BanIpLimit     = 10 // 现在IP错误密码次数
	UserTokenLimit = 10 // 用户token数量限制
	SmsCodeLimit   = 20 // 限制每天每个IP、用户发送短信数量

	StatusOk  = 1 //webscoket 正确响应code
	StatusErr = 0 //webscoket 错误响应code

	DownloadInitRequestMtype            = 1    //websocket下载模块初始化登录请求
	DownloadInitResponeMtype            = 1001 //websocket下载模块初始化登录响应
	AppInitRequestMtype                 = 2    //websocketAPP初始化登录请求
	AppInitResponeMtype                 = 1002 //websocketAPP初始化登录响应
	MtypeDownloadHeartRequest           = 201  //websocket下载模块心跳请求
	DownloadHeartResponeMtype           = 1201 //websocket下载模块心跳响应
	AppHeartRequestMtype                = 202  //websocket APP心跳请求
	AppHeartResponeMtype                = 1202 //websocket App心跳响应
	MtypePushTaskTodDownloadRequest     = 203  //websocket推送下载中队列至下载模块请求
	MtypePushTaskTodDownloadRespone     = 1203 //websocket推送下载中队列至下载模块响应
	MtypeDelTaskTodDownloadRequest      = 204  //websocket删除任务推送至下载模块请求
	MtypeDelTaskTodDownloadRespone      = 1204 //websocket删除任务推送至下载模块响应
	MtypeAppGetJoinDeviceInfoRequest    = 210  //websocketAPP 获取设备详情请求
	MtypeAppGetJoinDeviceInfoResponse   = 1210 //websocketAPP 获取设备详情响应
	MtypeAppGetRouterSpeedInfoRequest   = 101  //websocketAPP 获取路由器上下行速度信息请求
	MtypeAppGetRouterSpeedInfoResponse  = 1101 //websocketAPP 获取路由器上下行速度信息响应
	MtypeAppGetTaskListRequest          = 103  //websocketAPP 获取下载任务列表请求
	MtypeAppGetTaskListResponse         = 1103 //websocketAPP 获取下载任务列表响应
	MtypeRouterStorageScanRequest       = 102  //websocket  2.3.2	平台下发扫描目录命令给路由器请求
	MtypeRouterStorageScanResponse      = 1102 //websocketAPP 2.3.2	平台下发扫描目录命令给路由器响应
	MtypeRouterDelPathRequest           = 212  //websocket  2.3.2	平台下发扫描目录命令给路由器请求
	MtypeRouterDelPathResponse          = 1212 //websocketAPP 2.3.2	平台下发扫描目录命令给路由器响应
	MTypeRouterSetSpeedLimitRequest     = 209  //websocket  4.5	设置下载上传速度限制请求
	MTypeRouterSetSpeedLimitResponse    = 1209 //websocketAPP 4.5	设置下载上传速度限制响应
	MTypeRouterStorageOutNoticeRequest  = 205  //websocketAPP 4.1	外接设备插拔通知请求
	MTypeRouterStorageOutNoticeResponse = 205  //websocketAPP 4.1	外接设备插拔通知响应
	MTypeGetStorageParRequest           = 105  //websocketAPP 7.1	获取外接存储分区信息请求
	MTypeGetStorageParResponse          = 1105 //websocketAPP 7.1	获取外接存储分区信息响应
	MTypeTaskDealNoticeRequest          = 207  //websocketAPP 4.3	任务通知请求
	MTypeTaskDealNoticeResponse         = 1207 //websocketAPP 4.3	任务通知响应
	MTypeGetSearchLocalResponse         = 1104 //websocketAPP 3.2	下载模块搜索本地资源文件响应
	MTypeGetSearchLocalRequest          = 104  //websocketAPP 3.2	下载模块搜索本地资源文件请求
	MTypeSetPartitionResponse           = 1211 //websocketAPP 8.1	设置分区响应
	MTypeSetPartitionRequest            = 211  //websocketAPP 8.1	设置分区请求
	MTypeAppStorageNoticeRequest        = 206  //websocketAPP  4.2 外接存储拔插通知

	// 配置图片URL前缀
	PicPathPrefix = "http://tu.jstucdn.com/ftp/"

	// time 相关配置
	TimeFormatD       = "2006-01-02"
	TimeFormatS       = "2006-01-02 15:04:05"
	TimeFormatSecond  = 1
	TimeFormatMin     = 60
	TimeFormatHour    = 60 * 60
	TimeFormatCST     = 60 * 60 * 8
	TimeFormatDay     = 60 * 60 * 24
	TimeFormatWeek    = 60 * 60 * 24 * 7
	TimeFormatMonth   = 60 * 60 * 24 * 30
	TimeFormatYear    = 60 * 60 * 24 * 365
	TimeFormatTenYear = 60 * 60 * 24 * 365 * 10

	// redis 相关配置
	RedisExpireMinute       = 60
	RedisExpireMinute5      = 60 * 5
	RedisExpireMinute30     = 60 * 30
	RedisExpireHour         = 60 * 60
	RedisExpireDay          = 60 * 60 * 24
	RedisExpireMonth        = 60 * 60 * 24 * 30
	RedisUserToken          = "user:token:"
	RedisUserBanIP          = "user:ban:ip:"
	RedisSmsBanIP           = "user:sms:ban:ip:"
	RedisSmsSend            = "user:sms:send:ip:"
	RedisEmailSend          = "user:email:send:ip:"
	RedisUniqueCode         = "user:unique:code:"
	RedisUserLoginErr       = "user:login:password:"
	RedisUserInfo           = "user:info:"
	RedisGroupInfo          = "user:group:info:"
	RedisDeviceBind         = "user:bindUid:" // 路由器与用户绑定关系

	RedisRouterInfo         = ":info:base" // 路由器SN与Mac缓存键前缀
	RedisRouterPasswordInfo = ":info:password"
	RedisRouterWIFIInfo     = ":info:wifi"
	RedisRouterLimitSpeed   = ":info:limitSpeed" // 路由器限速


	RedisWsMidFix   = ":mid"     // websocket请求参数mid缓存键

	RedisStorageDownloadPath          = ":storage:partitionDPath" // 外接设备下载目录
	RedisSearchLocalMidCacheKey       = ":temp:marker:searchLocalMid"   // 设置WIFI速度设置文件标识
	RedisSearchLocalFilesCacheKey     = ":temp:marker:searchLocal:"     // 搜索本地资源文件列表
	RedisSearchLocalFilesPageCacheKey = ":temp:marker:searchLocal:page" // 搜索本地资源文件列表
	RedisSearchLocalFilesDoneCacheKey = ":temp:marker:searchLocal:done" // 搜索本地资源文件列表


	RouterMqRedisPrefix = "mq:"
	RouterRedisPrefix   = "router:"
)
